<?php

class Form_Message extends Zend_Form {
	 
     public function init (){
        $message = new Zend_Form_Element_Textarea('message');
		$message->addFilter('StringTrim')
			->addFilter('StripTags')
			->setRequired(true);
		$this->addElement($message);
			
		$submit  = new Zend_Form_Element_Submit('submit');
		$submit->setLabel('send');	
		$this->addElement($submit);
    }
    
//	public function __construct(){
//		$this->setName('form_message')
//			->setAction (Zend_Controller_Front::getInstance()->getBaseUrl().'/message/send')
//			->setMethod('post');
//		parent::__construct();
//		
//		$user_id = Zend_Auth::getInstance()->getIdentity()->id;
//		$user = new Model_Friend($user_id);
//		
//		$arr = array();
//		foreach ($user->getFriendsList($user_id) as $user_node) {
//			if($user_id==$user_node->user_id){
//				$friend_id =$user_node->user_friend; 
//			}else{
//				$friend_id =$user_node->user_id;
//			}
//			$model_user = new Model_User($friend_id);
//			$arr[$friend_id] = $model_user->login;
//		}
//		
//		$to = new Zend_Form_Element_Select("user_id");
//		$to->setRequired(true)
//			->setMultiOptions($arr);
//		
//		$message = new Zend_Form_Element_Textarea('message');
//		$message->addFilter('StringTrim')
//			->addFilter('StripTags')
//			->setRequired(true);
//			
//      	$submit  = new Zend_Form_Element_Submit('submit');
//		$submit->setLabel('send');
//			
//		$this->addElements(array($to, $message, $submit));
//	}
	
	
}
?>
